﻿using System.Configuration;

namespace ERP.Framework.Components.ConfigurationHelper
{
    /// <summary>
    /// Represents Database configuration key in config file
    /// </summary>
    public sealed class DatabaseConfigurationEntry : ConfigurationElement
    {
        #region Properties

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        [ConfigurationProperty("Name", DefaultValue = "", IsRequired = true)]
        public string Name
        {
            get
            {
                return this["Name"] as string;
            }
            set
            {
                this["Name"] = value;
            }
        }

        /// <summary>
        /// Gets or sets the connection string.
        /// </summary>
        /// <value>The connection string.</value>
        [ConfigurationProperty("ConnectionString", DefaultValue = "", IsRequired = true)]
        public string ConnectionString
        {
            get
            {
                return this["ConnectionString"] as string;
            }
            set
            {
                this["ConnectionString"] = value;
            }
        }

        /// <summary>
        /// Gets or sets the provider.
        /// </summary>
        /// <value>The provider.</value>
        [ConfigurationProperty("Provider", DefaultValue = "", IsRequired = true)]
        public string Provider
        {
            get
            {
                return this["Provider"] as string;
            }
            set
            {
                this["Provider"] = value;
            }
        }

        #endregion
    }
}
